<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script type="text/javascript" src="../js/drag.js"></script>
</head>
<body>

<div id="div_1" style="width: 40px; height: 40px; background-color: red;position: absolute;"></div>
<div id="div_2" style="width: 40px; height: 40px; background-color: yellow;position: absolute;"></div>
<div id="div_3" style="width: 40px; height: 40px; background-color: blue;position: absolute;"></div>

</body>
</html>
<script>
	// 面向对象
    new Drag('div_1');
	// 防止div移出窗口
	new LimitDrag('div_2');
	// 单个函数
	drag('div_3');
</script>